package com.test.learnkotlin.widget

import android.content.Context
import android.util.AttributeSet
import android.widget.LinearLayout
import android.widget.TextView
import com.test.learnkotlin.R
import com.test.learnkotlin.bean.BaseInfoType

class SingleItem(context: Context, attrs: AttributeSet? = null) : LinearLayout(context, attrs),
    PeopleDataInterface {
    var tv_item_value: TextView

    init {

        val view = inflate(context, R.layout.item_select, this)
        tv_item_value = view.findViewById(R.id.tv_item_value)
    }

    override fun setItemData(baseInfoType: BaseInfoType) {
        tv_item_value.setHint(baseInfoType.name)
    }

    override fun getSelectValueItemData(): String?  = tv_item_value.text.toString().trim()


}